Contagion dynamics in self-organized systems of self-propelled agents

We investigate the susceptible–infectious–recovered contagion dynamics in a system of self-propelled particles with polar alignment. Using agent-based simulations, we analyze the outbreak process for different combinations of the spatial parameters (alignment strength and Peclet number) and epidemic parameters (infection-lifetime transmissibility and duration of the individual infectious period). We show that the emerging spatial features strongly affect the contagion process. The ordered homogeneous states greatly disfavor infection spreading, due to their limited mixing, only achieving large outbreaks for high values of the individual infectious duration. The disordered homogeneous states also present low contagion capabilities, requiring relatively high values of both epidemic parameters to reach significant spreading. Instead, the inhomogeneous ordered states display high outbreak levels for a broad range of parameters. The formation of bands and clusters in these states favor infection propagation through a combination of processes that develop inside and outside of these structures. Our results highlight the importance of self-organized spatiotemporal features in a variety of contagion processes that can describe epidemics or other propagation dynamics, thus suggesting new approaches for understanding, predicting, and controlling their spreading in a variety of self-organized biological systems, ranging from bacterial swarms to animal groups and human crowds.

www.nature.com/scientificreports/ coordinated collective movement at the scale of the system and a variety of slowly-evolving, long-lived spatial structures, such as large-scale, high density bands or clusters [16][17][18][19] , which results in dynamical irreversibility of the system's behavior 20 . To properly describe the contagion process, we must therefore consider the various degrees of mixing and density distributions exhibited by different self-organized collective movement states.
In this work, we implement a susceptible-infectious-recovered (SIR) infection process 2,21 in a system of self-propelled agents with alignment and repulsion interactions to explore the impact of self-organized spatiotemporal structures on the contagion dynamics. Our results show that the epidemic outcome depends strongly on the specific emergent properties of each collective state. We observe that the outbreak thresholds are significantly lower in ordered states with large-scale clusters or band-like structures, and higher in ordered or disordered states with homogeneous density distributions. By comparing the contagion dynamics of different states, we find that the timescales of the emerging spatial structures and of the infection processes play an essential role in the epidemic outcome.

Results
We consider contagion dynamics in a system of self-propelled particles (agents). Individual particles are performing active Brownian motion, advancing with a constant self-propulsion speed v 0 while the heading angle θ i is subject to noise of intensity σ . Neighboring particles interact through short-ranged alignment forces, that facilitate the emergence of collective movement, and through distance-dependent repulsive forces. The strength of the alignment force is set by the inverse alignment relaxation time τ −1 . For simplicity, we assume that both interactions have the same range r int , so that two particles i and j interact (are in "contact") when their distance |� r ij | = |� r i − � r j | is smaller than r int .
In addition to the spatial dynamics, we implement a simple contagion process that does not affect the agent motion, which corresponds to the standard SIR model in epidemiology. Each agent i can be in one of three states: susceptible ( s i (t) = S ), infected ( s i (t) = I ), or recovered ( s i (t) = R ). A susceptible agent i can only become infected, with a base transmission rate β b , while it is in contact with at least one infected agent j. An infected agent recovers spontaneously with a recovery rate γ . Recovered agents cannot be reinfected. A detailed description of the full model is given in the "Methods" section.
The active Brownian particle model with interactions exhibits a rich phase diagram of different collective movement states as a function of two dimensionless parameters 18,20,22 : the Peclet number Pe, quantifying the persistence of individual movement, and the dimensionless interaction strength g, quantifying the relative strength of alignment versus noise. The different collective states can be quantified by the degree of orientational order , typically referred to as polarization, and by the degree of clustering . Detailed definitions of all these variables are provided in "Methods" section, whereas a detailed analysis of the different self-organized collective movement states has been recently presented by the authors 22 .
We begin by presenting in Fig. 1 the phase space of the spatial dynamics. Panels (a,b) display the values of the clustering and polarization for each parameter combination. Following our previous work 22 , we identify five different regions with distinct values of and , represented by the characteristic states labeled from (c-g) in panel (a). A snapshot of each corresponding state is presented in panels (c-g), where each particle is represented by a point that is colored according to its heading directions, as indicated by the color disk in the top-left corner. Panel (c) shows a typical snapshot of the disordered states found in the low and low region of the phase diagram, where there is no orientational order and the particles are homogeneously distributed in space. Panels (d,f) display the ordered state with bands (OB) and ordered state with clusters (OC), respectively. Both have high and values, but OB states form large density bands that are perpendicular to the heading direction, whereas OC states exhibit clusters that are elongated along the heading direction. Finally, panels (e,g) show two different ordered homogeneous states (OH-1 and OH-2), both of which are characterized by high and low values.
We now examine the effectiveness of the contagion process in different regions of the phase diagram, for various values of the contagion parameters, by computing the fraction of agents that were infected at some point of the epidemic process, which is equal to the final fraction of recovered agents. The infection spreading will depend on the rate and duration of the contacts between infected and susceptible agents that result from the spatial dynamics, and on the SIR model parameters β b and γ . We will express the latter in terms of two quantities that determine the effective contagion rate between susceptible interacting agents: the infection-lifetime transmissibility � = β b /γ (a nondimensional number that describes the average total transmission during the infectious period of an agent) and the mean duration of the infectious period of an agent T inf = 1/γ . The interplay between these quantities and the spatial dynamics determines the effective infection spread.
Note that there are two limit cases of the spatial dynamics where the final epidemic outcome will only depend on , and not on T inf : The well-mixed (mean-field) case, where agents are continuously exchanging neighbors, and the static interaction network case (if agents are close enough to form a connected graph), where the neighbors remain fixed. In both situations, the newly infected agents are continuously interacting with other agents that are potentially susceptible, so the duration T inf of their infectious state will not affect the outcome. Even in these limits, however, the contagion process before reaching this final outcome will also depend on T inf and on the spatial dynamics of the system, which will affect its timescale [13][14][15] . In more realistic cases where the interactions are determined by complex temporal networks 23 or spatiotemporal dynamics, as in the model considered here, both the epidemic outcome and the contagion process will generally depend on all parameters. www.nature.com/scientificreports/ completeness. We find that, in general, the regions with highest degree of contagion tend to match the regions with highest clustering in Fig. 1a, and that they grow as or T inf are increased. The central panels shows that, for an intermediate = 2.0 value, the region with high epidemic spreading matches almost exactly the high clustering regions OB and OC in Fig. 1, although some simulations with relatively high level of contagion can also be found in the disordered region. The top right panel shows that, for a very high = 100 , almost the whole phase space displays high levels of epidemic spreading, with the homogeneously ordered (OH) regions presenting the lowest levels. The bottom row shows that we obtain equivalent results if we instead vary T inf , but with larger ρ R (∞) differences between the regions with high and low epidemic spreading. Figure 3 provides a more detailed view of the effectiveness of each epidemic outbreak and its onset points, plotting ρ R (∞) as a function of and T inf for the five collective states identified in Fig. 1. Each point displays the mean value obtained for the 50 simulations performed per parameter combination and the error bar shows the corresponding standard deviation.

Contagion effectiveness.
Panel (a) confirms that outbreak onsets occur at the lowest ≈ 0.5 values in the inhomogeneous (OB, OC) states and at higher ≈ 1 values in the homogeneous disordered (D) and homogeneous ordered (OH-1, OH-2) states. The value of ρ R (∞) then increases with at a different rate for each case. At an intermediate ≈ 10 , we find that the OB state has the highest mean ρ R (∞) , followed closely by the OC and disordered states. For very large 200 , the disordered and OB states display the highest, very similar ρ R (∞) ≈ 0.8 values, whereas the OC case seems to saturate at a slightly lower level. Instead, both OH states display a significantly lower level of epidemic spreading, with a fraction of recovered agents ρ R (∞) ≈ 0.3 that is slightly higher for OH-1 than for OH-2.
Panel (b) shows that the outbreak onsets occur at very different T inf levels in the disordered, OH-1, and OH-2 states (order 10 1 , 10 2 , and 10 3 , respectively). These three homogeneous states eventually reach high infection levels, but only for very high T inf values. This panel also shows that, in the = 2 case considered here, states OC and OB develop high levels of infection for all T inf values. Even at a very low T inf = 10 −2 we find that, remarkably, they still display significant outbreaks, with ρ R (∞) 0.4 . In the opposite limit, for a very high T inf = 10 4 , both converge to a similar state of full epidemic spreading, with ρ R (∞) ≈ 1. www.nature.com/scientificreports/ Analysis of the contagion process in different collective states. The above results show that the infection parameters and the spatial dynamics both play an essential role in the contagion spread. In particular, we observe that complex self-organized states tend to result in higher levels of infection than the typically studied states with either well-mixed or static interactions. Furthermore, the specific nature of the spatial dynamics appears to play an essential role that cannot be captured by standard averaged network-based descriptions. In the following, we will analyze in detail the spreading process in the different identified collective regimes. www.nature.com/scientificreports/ Disordered states. We begin with the simplest case, the homogeneous disordered state, in which all agents are continuously mixing with similar contact dynamics that do not change over time. The contagion process is the closest here to a mean-field SIR system, where the final epidemic spreading can be predicted if T inf is sufficiently large 14 . In this regime, agents remain infectious for long periods, while they mix with the whole system. This implies that initially localized infections will quickly produce outbreaks throughout the simulation arena, as shown in Fig. 4, We can thus estimate the fraction of infected agents at the end of the run by using semi-analytical mean-field calculation. We present these results in the Supplementary Information, obtained by extending the analyses performed in 13-15 for a similar case that considered the SIS model and active Brownian particles. For a smaller values of T inf , however, the mixing timescale can be comparatively too long for new susceptible agents to continue to be exposed to infected agents before they recover, since the front advances slower over time, and the infection will eventually die out. This can be overcome by increasing the spatial density of initially infected agents, as we also discuss in the Supplementary Information. In a scenario with a spatially homogeneous distribution of initial infections (or infection clusters), for example, we may observe a percolation-like merging of the different locally expanding fronts, which can result in almost the entire system being infected even for short T inf values.
Ordered homogeneous state. In the ordered homogeneous states, OH-1 and OH-2, the high level of polarization results in slow mixing and thus in a low mean contact rate between new neighbors. Therefore, sufficiently high and T inf values are both crucial for the contagion process to develop. For low T inf , the interaction network will not experience significant changes before the infected individuals recover, and can thus be approximated by a static network. In this case, the epidemic spreading can be viewed as a percolation process on this network. For a low mean density, the sparse connectivity can therefore place the system below the percolation threshold, stopping contagion even for extremely high values, as shown in Fig. 3a. For higher T inf , local velocity fluctuations will lead to the accumulation of contacts with different neighbors during this period, increasing the effective connectivity, given here by the time-averaged interaction network. This can result in higher epidemic spreading than in the disordered homogeneous state, as we can see in Fig. 3b. Note, however, that these fluctuations can also produce more mixing between susceptible and recovered agents at the infection propagation front, which would reduce the fraction of agents that are available for contagion at this interface and thus limit the epidemic growth. This effect has been observed in the literature 24 for a system of particles moving in straight lines with random directions, where an optimal mixing speed that minimizes spreading was identified in a regime between quasi-static network percolation and high mixing. Although we did not detect this type of effect in our simulations, it could be present for other parameter combinations. A more detailed inspection of the contagion process in the ordered homogeneous states shows that it develops spatial dynamics that cannot be described by simple percolation or mixing approximations. In particular, in this regime the agents are known to display superdiffusive displacements perpendicular to the mean heading 25,26 , which will result in a faster propagation of the infection along this direction. Starting from a localized outbreak, we thus observe the rapid initial formation of a band-like infected region perpendicular to the mean agent orientation, which is then advected by the mean flow, as shown in Fig. 5. This type of contagion process was identified in all our simulations of states OH-1 and OH-2; we expect it to also be present in any ordered homogeneous state of self-propelled particles with similar dynamics.
Although the two ordered homogeneous states seem to display a similar contagion process, the level of epidemic spreading is strongly conditioned by their specific spatial dynamics. Indeed, since OH-2 has a higher alignment strength g than OH-1, it will present a lower mean contact rate and longer typical contact duration 22 , which will result in a much smaller effective contagion rate. This explains its higher onset value ( T inf 10 3 ) and the fact that, even for T inf = 10 4 , the effectiveness of the epidemic outbreak only reaches ρ R (∞) ≈ 0.5 in Fig. 3b.
The details of the infection dynamics of the two ordered homogeneous states also appear to be different, as shown in the simulation videos in the Supplementary Material (OH-1.mp4, OH-2.mp4). The outbreaks in state OH-1 typically develop approximately homogeneously throughout the simulation arena. By contrast, the outbreaks in state OH-2 appear to develop mainly inside large clusters that emerge sporadically during the simulations and survive for relatively short periods of time, spreading less effectively outside of them. We note, however, that we only studied the OH-2 outbreaks for T inf = 10 4 , where they become more prevalent. We did not explore Figure 4. Infection dynamics in a disordered homogeneous state. The greyscale lattice displays the smoothed local mean density of all agents within each square bin. Overlaid dots, colored from white to red, show the density of agents in state I (i.e., of infectious agents) only on bins where I > 0 . The spatial dynamics corresponds to the disordered homogeneous state D presented in Fig. 1, with (Pe,g) = (32,1). The panels display the temporal evolution of a single infection process (with T inf = 10 3 and = 2 ) started by 10 agents at the center of the arena. We observe that the initial localized outbreak can quickly infect agents anywhere in the system. www.nature.com/scientificreports/ the asymptotic behavior in this state for larger T inf ≫ 10 4 because this would require extremely long simulations that go beyond the scope of this work, given that the time needed to reach a final infection state grows with T inf and that the dynamics for high coupling strengths can only be resolved with very small timesteps. Finally, we point out that the differences in the contagion processes of OH-1 and OH-2 are expected to disappear for large T inf → ∞ , since the infection timescales will become so long that the spatial dynamics will effectively result in well-mixed systems over comparatively short timescales, and can thus be averaged over time.
Ordered band state. In the ordered states with bands, or OB states, the system can be divided into two regions: the high density, high polarization regions within the bands, and the low density, low polarization, gas-like regions outside of the bands. The infections that develop outside the bands will thus take place in regions that are similar to the disordered states and have lower density than the system average. Therefore, for the contagion to spread in this region, and T inf must be higher than the corresponding epidemic thresholds in the disordered state, since lower density implies less interactions between infected and susceptible agents. Otherwise, we find in simulations that the infection will die out quickly, unless it is transmitted to a band. Instead, the infections that develop within the bands take place in regions with higher local density and polarization. Agents will have more interactions that last longer while the combination of high density and repulsion will inhibit mixing, so the contagion process will be predominantly driven by percolation. Our simulations show that the successful propagation of infection within the bands requires a significantly lower and T inf , as we can see in the left side of the OB curve in Fig. 3b. In this context, in the OB states a contagion spreading process that starts within a band will typically develop as visualized in Fig. 6 and can be described as follows. The initial infections within the bands will propagate more efficiently, due to their higher local densities. Once a significant fraction of a band is infected, given that bands advance faster than the mean agent velocity between bands due to their higher polarization, it will develop a contagion process that can span the system by sweeping through the arena, reaching the susceptible agents in the gas-like state outside the band. Therefore, the epidemic spreading is initially controlled by , which needs to be high enough to grow the infection within a band, and later by T inf , which will determine the level of contagion outside the band when compared to the time required for the band to swipe the system.
Ordered clustered state. The ordered clustered states, or OC states, typically contain one or more large polarized clusters that are elongated along their heading direction, surrounded by lower density regions. An example of an infection process observed in one of these states is displayed in Fig. 7. As in the OB states, the contagion develops differently inside and outside of these clusters. In contrast to the OB states, however, the low density regions outside of the clusters have relatively high levels of polarization, albeit smaller than within clusters. The contagion dynamics outside the clusters is thus similar to the percolation process in the homogeneous ordered states, but will require higher and T inf values to propagate successfully, due to the lower density. Otherwise, Figure 5. Infection dynamics in an ordered homogeneous state, visualized as in Fig. 4. The spatial dynamics corresponds to the ordered homogeneous state OH-1 presented in Fig. 1, with (Pe,g) = (512,16), here advancing to the right as indicated by the white arrow. The panels display the temporal evolution of a single infection process (with T inf = 10 3 and = 2 ) started by 10 agents at the center of the arena. We observe that the infection initially propagates forming a band perpendicular to the heading direction. Figure 6. Infection dynamics in an ordered band state, visualized as in Fig. 4. The spatial dynamics corresponds to the ordered band state OB presented in Fig. 1, with (Pe,g) = (32,2), here advancing to the right as indicated by the white arrow. The panels display the temporal evolution of a single infection process (with T inf = 10 3 and = 2 ) started by 10 agents within the band. We observe that the infection spreads first within the band, and then outside of the band. www.nature.com/scientificreports/ our simulations show that any infection that starts outside the clusters will die out quickly, unless it spreads into a cluster. We also observe that, in cases where contagion does develop outside of the clusters, the infection spreads faster perpendicular to the heading direction, as in the OH states. Inside the clusters, the contagion spreads primarily through percolation on a quasistatic network, because of the weak local mixing. The densities are higher within these regions than in the homogeneous ordered states or inside the bands in the OB states, so the infection process is very effective and requires the lowest and T inf values to spread. This explains the low and T inf behavior of the OC state in Fig. 3. However, the epidemic spread inside the clusters is significantly slower than within bands, as we can see by comparing the temporal dynamics of Figs. 6 and 7. This can be explained by the fact that particles exhibit much stronger diffusion within bands than inside clusters, especially perpendicular to the movement direction. After a cluster gets infected in an OC state, the contagion process to other regions can be quite complex, as it involves two mechanisms. On the one hand, clusters do not frequently interact with new off-cluster agents or with other clusters, since all the particles in the system are approximately aligned. This implies that, for low or intermediate T inf , the infection inside a cluster may never spread outside. On the other hand, clusters exhibit rich fission-fusion dynamics at long timescales, through which an infected cluster that disaggregates can infect other clusters, if its resulting fragments aggregate into them, as shown in a simulation video in the Supplementary Material (OC-2.mp4). As a result, although the infection within a cluster can be very effective even for low and T inf , its spreading to the rest of the system depends on the balance between these two processes that develops in each realization of the spatial dynamics. It is this lack of a reliable mechanism for spreading the infection throughout the system that makes the OC states reach a slightly lower ρ R (∞) level than the disordered and OB states for intermediate and high and T inf values in Figs. 2 and 3.

Discussion and conclusions
In this work, we investigated a simple SIR epidemic process in a system of self-propelled agents with alignment interactions. We showed that the contagion dynamics and the overall outbreak magnitude depend strongly on the spatiotemporal collective states. In particular, we found that effective infection spreading can be favored by self-organization. Our analyses followed a minimal modeling approach to show potential generic connections between emergent spatiotemporal dynamics and the spreading of epidemics that could have strong impact on a variety of real-world scenarios. Although our results were mainly expressed in terms of epidemic spreading, we note that they can also describe other processes, such as the propagation of different types of information within groups of agents. We note that self-organized spatial structures may appear due to different mechanisms. A prominent example is the emergence of dense stationary clusters for active Brownian particles with repulsion but without alignment interactions due to motility induced phase separation (MIPS) 20,27 . However, the temporal dynamics of such disordered, non-moving MIPS clusters is fundamentally different to the dynamical, moving structures formed by self-propelled particles with alignment interactions studied here.
The analyses carried out above can be summarized in terms of general contagion processes that develop on evolving networks. From this perspective, the emerging spatial structures (bands, clusters, and homogeneous fluid or gas states) correspond to different evolving contact networks. The resulting contagion spread is determined by the dynamics within these structures and by the interactions between them. On the one hand, the infection process is affected by the self-organized rewiring dynamics inside the corresponding sub-networks, which is driven by underlying processes such as (active) diffusion, convection, and density fluctuations. It may therefore exhibit very different and T inf dependencies, as well as rich phenomena, such as asymmetric spread in the form of a "contagion band" in ordered homogeneous states. On the other hand, the self-organized contact dynamics between different spatial structures or sub-networks, such as fission-fusion processes that develop between clusters, plays a decisive role in determining large-scale contagion, thus introducing additional (long) time-scales that can lead to highly non-trivial spreading processes. This situation changes only in the limit of very long infection duration T inf , where all the timescales of the spatial dynamics become negligible, which results in an effective contagion process that is equivalent to the well-mixed case.
Revealing the impact of self-organized collective behavior 22,28 on contagion processes is essential for understanding the functional aspects of a variety of behaviors exhibited by biological collectives (such as the risk-related behavior observed in fish 7 ). In bacterial swarms, for example, the spreading of genetic information (through direct contacts or via bacteriophages 29 ) is conditioned by the self-organized coordinated motion and cluster  Fig. 4. The spatial dynamics corresponds to the ordered clustered state OC presented in Fig. 1, with (Pe,g) = (32,128), here advancing to the right as indicated by the white arrow. The panels display the temporal evolution of a single infection process (with T inf = 10 3 and = 2 ) started by 10 agents within a cluster. We observe that the infection initially spreads within the cluster, slowly but robustly, and then reaches other clusters through their fission-fusion dynamics. www.nature.com/scientificreports/ formation that emerges from simple physical interactions [30][31][32] . These genetic propagation dynamics are believed to play an important role in key processes such as the spread of antibiotic resistance in bacterial populations 33,34 .
A better understanding of this type of phenomena will thus require further studies of the interplay between infection spreading and collective spatiotemporal dynamics that could be built on the results presented in this paper. At the macroscopic agent scale, the relationship that we analyzed here between spatiotemporal self-organization and contagion dynamics is expected to be highly relevant for a variety of systems, ranging from animal groups to human crowds, which are known to often form dense gatherings with complex fission-fusion dynamics [35][36][37] . This could affect processes that require containment, such as disease spreading, or that are typically beneficial, such as the diffusion of information.
Despite using highly idealized models, our work could have relevant implications in the development of strategies for the control of epidemics. For example, our results show that, for a broad range of parameters, outbreaks are significantly reduced in the homogeneous ordered states when compared to other states with the same, relatively low, mean density. In the context of the current COVID-19 pandemic, this suggests the development of crowd control strategies that favor the homogeneous spreading of individuals to help minimize contagion during large gatherings. On a more general note, our minimal agent-based descriptions show that the contagion dynamics is often not adequately captured by the averaged network approaches commonly used to predict epidemic spreading. This is especially true in the presence of self-organized spatiotemporal features, which could help explain the very limited success that has been achieved in predicting outbreaks during this pandemic. Future studies could improve the level of description considered in this paper by including other potential couplings between the spatial dynamics and the contagion process. In a recent study 38 , for example, flocking agents alter their motion when they get infected, which can strongly affect the contagion spreading. This type of additional considerations could help complete the characterization of simple systems that combine spatial and epidemic models, and will be left for future work.

Methods
Individual-based model. We consider a system of N self-propelled agents moving continuously in a twodimensional arena of size L × L , with periodic boundary conditions. At time t, agent i is located at position r i (t) and tends to advance in its heading direction n i = [cos θ i (t), sin θ i (t)] T with constant self-propulsion speed v 0 , while also being displaced by local soft-core repulsion forces F i between neighbors. The corresponding equation for a system with overdamped dynamics is given by We define the interaction set S i = j||� r ji | ≤ � r int , with � r ji = � r i − � r j , as containing all neighbors within a range r int of the focal particle i. In order to reduce the parameter space, the alignment and repulsive interactions are defined as having the same range. These interactions are given by Here, τ is a relaxation time that controls the strength of the alignment, mod * (x) = mod(x + π, 2π) − π is a modified modulo function that produces values between − π and π , and σ is the strength of a δ-correlated Gaussian white noise introduced through a random variable ξ θ that satisfies �ξ θ � = 0 and �ξ θ (t 1 )ξ θ (t 2 )� = δ(t 2 − t 1 ) . Each particle thus tends to align its heading angle θ i (t) to its neighbors, while subjected to noise, and is displaced by repulsive forces F i (t) that do not affect its heading direction.
We combine the above movement model with a standard SIR-model. Each agent i is assigned an internal ternary variable s i (t) ∈ {S, I, R} , representing its current contagion state: susceptible ( s i (t) = S ), infected ( s i (t) = I ), or recovered ( s i (t) = R ). A susceptible agent i can only become infected, with a base transmission rate β b , while it is in contact with at least one infected agent j (i.e., at a distance smaller than the interaction range |r ij | ≤ r int ).
Its infection probability when in contact with a single infected neighbor for a short time period t will thus be given by p inf = β b �t . If a susceptible agent is in contact with multiple infected agents simultaneously, all pairwise interactions are assumed to be statistically independent and its infection probability is therefore given by the sum of the individual probabilities. Note that, for a sufficiently small numerical time step t and a finite number of neighbors, the infection probability per numerical integration step is typically well below 1. On the other hand, an infected agent spontaneously recovers at a rate γ , that is, with probability equal to γ �t for a small enough t . We consider here the recovered state to be an absorbing state of the contagion dynamics, so no infections can reoccur in recovered agents.
It is important to point out that the base transmission rate β b , as defined above, is different from the transmission rate parameter in standard epidemiological compartment models, typically denoted as β . For a short contact duration t the following relations holds β = β b ν�t , with ν being the contact rate.
Following the SIR dynamics defined above, an initial number of infected agents can result in a contagion process that spreads to other agents, all of which will eventually recover spontaneously until no infected agents remain in the system, ending the outbreak. If we define ρ I (t) , ρ S (t) and ρ R (t) as the fraction of the total population that is infected, susceptible, or recovered at time t, respectively, this corresponds to reaching a state with (2) dθ i (t) dt = 1 τ mod * (θ j − θ i ) j∈S i + σ ξ θ , www.nature.com/scientificreports/ ρ I (∞) = 0 and ρ S (∞) + ρ R (∞) = 1 , where t = ∞ denotes any time t after the SIR dynamics has reached its final absorbing state. The effectiveness of the epidemic outbreak can then be measured by the value of ρ R (∞).

Dimensionless parameters.
We investigate the contagion process for a system of self-propelled agents in different types of collective states 22 . These correspond to distinct regions of the phase space that is spanned by two nondimensional control parameters, the Peclet number Pe and the effective coupling strength g, defined as The Peclet number quantifies the level of persistence in individual movement, with Pe → 0 corresponding to noise dominated Brownian motion and Pe → ∞ describing ballistic motion for vanishing angular noise. The effective coupling g , quantifies the strength of the alignment interaction relative to the angular noise.
Macroscopic state variables. Each region in the (Pe,g) parameter space is characterized by different degrees of alignment and clustering, which is measured by two order parameter, and , respectively. More specifically, the degree of alignment is given by the polarization where = 1 if all particles are heading in exactly the same direction and ≈ 0 if they are moving in random directions.
The clustering is defined as the fraction of the total number of particles that conform the largest cluster in the system, where the members of a cluster are determined to be all particles within a distance r int of any other particle also in the cluster. Therefore, for the relatively low mean density value considered in this paper, � = 1/N ≪ 1 describes a homogeneous state in which the distance between all neighbors is larger than the interaction range, whereas = 1 corresponds to a highly inhomogeneous state where all agents belong to a single cluster.

Numerical simulations.
We considered different collective states in the (Pe,g) phase space by varying the noise σ and alignment relaxation time τ , while keeping a fixed preferred agent speed v 0 = 0.2 and interaction range r int = 1 , in order to limit the parameter exploration. We also fixed the mean density to a packing fraction of Nπ r 2 int /(4L 2 ) = 0.3 , by simulating N = 10, 000 agents in an arena of size L ≈ 161 . A detailed analysis of the different spatial dynamics and collective states obtained in this system was recently presented in 22 . Starting from statistically stationary states of the spatial dynamics, we implemented the SIR process by infecting 100 agents, which corresponds to 1 percent of all particles. For each parameter combination, we considered 5 independently converged stationary states and initialized 10 contagion processes, each starting from a different set of randomly selected infected agents. Hence, a set of 50 simulations was used to characterize the epidemic spreading for each case.